package design.singleton;

/**
 * <p>
 *  Singleton Test
 * </P>
 *
 * @author dingwen
 * @date 2021.10.14 15:47
 */
public class SingletonTest {
    public static void main(String[] args) {
        Singleton1 instance1 = Singleton1.getInstance();
        System.out.println("instance1.hashCode() = " + instance1.hashCode());

        Singleton2 instance2 = Singleton2.getInstance();
        System.out.println("instance2.hashCode() = " + instance2.hashCode());


        Singleton3 instance3 = Singleton3.getInstance();
        System.out.println("instance3.hashCode() = " + instance3.hashCode());

        Singleton4 instance4 = Singleton4.getInstance();
        System.out.println("instance4.hashCode() = " + instance4.hashCode());

        Singleton5 instance5 = Singleton5.getInstance();
        System.out.println("instance5.hashCode() = " + instance5.hashCode());

        Singleton6 instance6 = Singleton6.getInstance();
        System.out.println("instance6.hashCode() = " + instance6.hashCode());


    }
}
